//
// Created by haoy on 2017/7/27.
//

#ifndef RTC_XSWITCH2_NACK_HANDLER_HPP
#define RTC_XSWITCH2_NACK_HANDLER_HPP

#include <stdint.h>
#include <list>

#include "xrtc_endpoint.h"

class nack_handler;
typedef nack_handler* nack_handler_t;

struct nack_request {
public:
    nack_request(uint16_t pid, uint16_t blp) : pid(pid), blp(blp) {}

    uint16_t pid;
    uint16_t blp;
};

nack_handler_t nack_handler_new();
void nack_handler_delete(nack_handler_t nh);
//void nack_handler_reset(nack_handler_t nh);
//void nack_handler_receive_seq(nack_handler_t nh, uint16_t seq);
void nack_handler_receive_seq(nack_handler_t handler, int64_t now_ms, uint16_t seq, std::list<nack_request> &reqs);
//void nack_handler_search_request(nack_handler_t nh, std::list<nack_request> &reqs);

#endif //RTC_XSWITCH2_NACK_HANDLER_HPP
